package com.springboot.example.web.web;

//import com.dianping.cat.Cat;
//import com.dianping.cat.message.Event;
//import com.dianping.cat.message.Transaction;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 作者: guo yao
 * 日期: 2016年01月20日
 * 时间: 下午10:12
 */
@RestController
@RequestMapping("/index")
public class WebController {

    private static Logger log = LoggerFactory.getLogger(WebController.class);

    @RequestMapping("/main.html")
    public String main() {
        System.out.println("方法");
        System.out.println("=====方法======");
        System.out.println("=====方法======");
        System.out.println("======方法=====");
        log.trace("======trace");
        log.debug("======debug");
        log.info("======info");
        log.warn("======warn");
        log.error("======error");
        return "Hello World! Web";
    }

    /*@RequestMapping("/index.html")
    public String index() {
        Transaction t = Cat.newTransaction("URL", "index.html");
        try {
            Cat.logEvent("URL.Server", "127.0.0.1", Event.SUCCESS, "ip=127.0.0.1");
            Cat.logMetricForCount("index");
            Cat.logMetricForSum("count", 1);
            System.out.println("into index");
            t.setStatus(Transaction.SUCCESS);
        } catch (Exception e) {
            t.setStatus(e);
        } finally {
            t.complete();
        }

        return "index";
    }*/
}
